package cn.hfjava.quickhit;

import java.util.Scanner;

public class Player {
    private int levelNo;
    private int currScore;
    private long startTime=0;
    private int elapsedTime;

    public Player() {
        super();
    }

    public Player(int levelNo, int currScore, long startTime, int elapsedTime) {
        super();
        this.levelNo = levelNo;
        this.currScore = currScore;
        this.startTime = startTime;
        this.elapsedTime = elapsedTime;
    }

    public int getLevelNo() {
        return levelNo;
    }

    public void setLevelNo(int levelNo) {
        this.levelNo = levelNo;
    }

    public int getCurrScore() {
        return currScore;
    }

    public void setCurrScore(int currScore) {
        this.currScore = currScore;
    }

    public long getStartTime() {
        return startTime;
    }

    public void setStartTime(long startTime) {
        this.startTime = startTime;
    }

    public int getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(int elapsedTime) {
        this.elapsedTime = elapsedTime;
    }
    public void play(){
        Game game = new Game(this);
        Scanner input = new Scanner(System.in);
        for (int i = 0;i < LevelParam.levels.length ;i++ ){
            levelNo += 1;
            startTime = System.currentTimeMillis();
            currScore = 0;
            for (int j = 0;j < LevelParam.levels[i].getStrTime() ;j++ ){
                String out = game.printStr();
                String in = input.next();
                game.printResult(out,in);

            }
        }
    }
}

